package com.tangbao.util;

import java.util.HashMap;

/**
 * Created by Administrator on 2017/3/13.
 */
public class ResEntity extends HashMap<String,Object> {
    public final static String SUCCESS = "success";
    public final static String MSG = "message";
    private ResEntity(){
        super();
    }


    public static ResEntity okEntity(){
        return new ResEntity().put(SUCCESS, true);
    }
    public static ResEntity errorEntity(String msg){
        ResEntity et= new ResEntity().put(SUCCESS, false);
        et.put(MSG,msg);
        return et;
    }
    public static ResEntity errorEntity(){
        return new ResEntity().put(SUCCESS, false);
    }
    public ResEntity put(String key,Object value){
        super.put(key, value);
        return this;
    }
}
